#ifndef VIDEOLIST_H
#define VIDEOLIST_H

#include <QWidget>
#if 0
#include <QQuickView>
#include <QQmlContext>
#endif
#include "keythread.h"

#include <QListView>
#include <QStack>
#include <QDir>
#include <QFileInfo>
#include <QScroller>
#include <QLabel>

#include "mymodel.h"
#include "config.h"
#include "loading.h"
#include "listwidget.h"
#include "tipwidget.h"
#include "videowidget.h"

extern "C"{
#include <sys/types.h>
#include <dirent.h>
}

struct Data_t{
    QString name;
    QString path;
    int type;
};

class VideoList : public QWidget
{
    Q_OBJECT
public:
    explicit VideoList(QWidget *parent = nullptr);
    ~VideoList();
/*
    QQmlContext *mQuickContext;
    QQuickView *mQuickView;
*/
    MyModel *model;
    void KeyEvent(Key_t, int);

    bool isloading = true;
    Loading *loading;
    QStack<QString> stack;
    void addFolderImages(QString path="");

public slots:
    void clicked(const QModelIndex &index);
    void listCurrentFiles(QString root);
    void slotChangeVideo(int);
signals:
    void referList(QList<Data_t>);
    void sigClose();
    void sigChangeVideo(QString);
};

#endif // VIDEOLIST_H
